﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace frm_view
{
    public partial class frmBai : Form
    {
        bool IsInsert = false;
        void KhoaDieuKhien()
        {
            txtMaBai.Enabled = false;
            txtNoiDung.Enabled = false;
            txtTenBai.Enabled = false;
            cbbChuong.Enabled = false;

            btnSave.Enabled = false;
            btnDelete.Enabled = true;
            btnInsert.Enabled = true;
            btnUpdate.Enabled = true;
        }

        void MoDieuKhien()
        {
            txtMaBai.Enabled = true;
            txtNoiDung.Enabled = true;
            txtTenBai.Enabled = true;
            cbbChuong.Enabled = true;

            btnSave.Enabled = true;
            btnDelete.Enabled = false;
            btnInsert.Enabled = false;
            btnUpdate.Enabled = false;
        }
       // ctrls_Chuong obj_chuong = new ctrls_Chuong();

        public frmBai()
        {
            InitializeComponent();
        }
      //  ctrls_Bai obj_bai = new ctrls_Bai();
      //  EN_Bai obj_en_bai = new EN_Bai();
        private void ViewBai_Load(object sender, EventArgs e)
        {
          
        }

        private void btnInsert_Click(object sender, EventArgs e)
        {
           
        }

        private void btnUpdate_Click(object sender, EventArgs e)
        {
           
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
           
        }

        private void msds_Click(object sender, EventArgs e)
        {
           
        }

        private void btnLink_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            //ofd.Filter = "Text File (*.rtf)|*.rtf";
            if (ofd.ShowDialog() == DialogResult.OK)
                txtNoiDung.Text = @"\" + ofd.FileName.Substring(ofd.FileName.LastIndexOf("\\") + 1); ;
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
        
        }
        public event EventHandler closeBai;
        private void frmBai_FormClosing(object sender, FormClosingEventArgs e)
        {
            closeBai(this, new EventArgs());
        }
    }
}
